/**
 * 
 */
package teehee.Action;

import java.util.ArrayList;

import teehee.Dispatch.AddNewDispatch;
import teehee.DB.DB;

import android.content.Context;

/**
 * @author 
 *
 */
public class AddNewAction extends Action
{
	public static boolean createNewEntryAction(Context ctx, String type, String name,
			String reps,String time, String weights, String comments, ArrayList<String> exercises) {
		// change the format for both name and exercises, replace space with '_'
		name = Action.convertToDbFormat(name);
		for (int i = 0 ; i < exercises.size() ; i++ ) {
			exercises.set(i, Action.convertToDbFormat(exercises.get(i)) );
		}
		return AddNewDispatch.createNewEntryDispatch(ctx, type, name, reps, time, weights, comments, exercises);
	}
	
	public static DB AddNewActionFind(String name)
	{
		if(name != null)
		{

			name = Action.convertToDbFormat(name);
			DB entry = AddNewDispatch.AddNewDispatchFind(name);
			return entry;
		}
		return null;		
	}
}
